﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TTEngine
{
    public static class Globals
    {
        public const char TERRAIN_FLOOR = 'X';
        public const char TERRAIN_WALL = '-';
        public const char TERRAIN_DOOR = 'D';
        public const char TERRAIN_PIT = '_';
        public const char TERRAIN_PLATFORM = '^';
        public const char TERRAIN_STAIRS = 'S';

        public static Random Random = new Random();
        public static Party Party = new Party();
        public static Actor PathLooker = null;

        //random number functions
        public static int RandomIntFromTo(int from, int to)
        {
            int range = to - from + 1;
            double d = Random.NextDouble();
            return (int)(d * range) + from;
        }

        public static Color RandomColor(int minR, int maxR, int minG, int maxG, int minB, int maxB)
        {
            byte r = (byte)(Random.Next(maxR - minR) + minR);
            byte g = (byte)(Random.Next(maxG - minG) + minG);
            byte b = (byte)(Random.Next(maxB - minB) + minB);
            return Color.FromArgb(r, g, b);
        }

        public static string TerrainDescription(this char terrain)
        {
            switch (terrain)
            {
                case Globals.TERRAIN_DOOR:
                    return "door";
                case Globals.TERRAIN_FLOOR:
                    return "floor";
                case Globals.TERRAIN_PIT:
                    return "pit";
                case Globals.TERRAIN_PLATFORM:
                    return "platform";
                case Globals.TERRAIN_STAIRS:
                    return "stairs";
                case Globals.TERRAIN_WALL:
                    return "wall";
                default:
                    throw new ArgumentException("Unknown Terrain: " + terrain);
            }
        }
    }

    public enum OrderType { None, Move, Escort, MoveRandomly, Climb }
    public enum StressType { Thrown, UsedAsWeapon, UsedForPrimaryPurpose }
    public enum Abilities { Strength, Dexterity, Intellect, Charm }
}
